<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html>
<head>
<title>修改新闻</title>
<%@ include file="/WEB-INF/views/manager/include.inc.jsp"%>
<link rel="stylesheet" href="${contextPath }/styles/validationEngine/css/validationEngine.jquery.css">
<link rel="stylesheet" href="${contextPath }/styles/zTree/css/zTreeStyle/zTreeStyle.css">
<script src="${contextPath }/styles/validationEngine/js/jquery.validationEngine-zh_CN.js"></script>
<script src="${contextPath }/styles/validationEngine/js/jquery.validationEngine.min.js"></script>
</head>
<body>	
<!--top s-->
<c:import url="/public/header?tag=Config" />
<!--top end-->
<div class="m_main"> 
  <!--left s-->
  <c:import url="/public/left?tag=Config&tag1=Article" />
  <!--left end--> 
  <!--right s-->
  <div class="m_right fl">
    <div class="r_box">
      <div class="title1">
        <h3>修改新闻</h3>
      </div>
      <div class="listbox ovh">
        <form id="form" method="post" action="${contextPath }/manager/article/update" onsubmit="return validateCallback(this, callbackRef);">
          <ul class="dept2 fmy">
            <li>
              <div class="spant tr fl"><span class="s_red">*</span><span class="justify">栏目</span></div>
              <input id="select_column" type="text" class="treeint intt2 ell validate[required]" readonly value="${article.column.name }" />
              <input type="hidden" name="column.id" value="${article.column.id }" />
            </li>
            <li>
              <div class="spant tr fl justify"><span class="s_red">*</span><span class="justify">标题</div>
              <div style="position:relative;margin-bottom: 30px;"><textarea name="title" cols="" rows="" style="height: 40px;" class="textat validate[required,maxSize[60]]">${article.title }</textarea></div>
            </li>
            <li>
              <div class="spant tr fl justify"><span class="s_red">*</span><span class="justify">作者</div>
              <div style="position:relative;"><input name="author" type="text" class="intt validate[required,maxSize[16]]" value="${article.author }" /></div>
            </li>
            <li id="li_img">
              <c:if test="${not empty article.url}">
            	<div class="spant tr fl justify"><span class="justify">图片预览</div>
            	<div style="position:relative;">
            	  <img src="${contextPath }${article.url }" onload="resizeImg(this, 160, 80)" onmouseover="originalImg(this)" onmouseout="resizeImg(this, 160, 80)" style="cursor:pointer;" />
            	</div>
              </c:if>
            </li>
            <li>
              <div class="spant tr fl justify"><span class="justify">图片</div>
              <div style="position:relative;">
		        <input type="file" id="file" name="file" />
	            <input type="hidden" name="url" value="${article.url }" />
              </div>
            </li>
            <li>
              <div class="spant tr fl justify"><span class="justify">内容</div>
              <div style="position:relative;margin-left:105px;"><script id="container" name="content" type="text/plain">${article.content }</script></div>
            </li>
          </ul>
          <div class="btn_box tc ovh">
            <input type="hidden" name="id" value="${article.id }" />
            <input type="button" class="back_btn" onclick="history.go(-1)" value="返 回" />
            <input type="submit" name="submit" class="keep_btn" value="保 存">
          </div>
        </form>
      </div>
    </div>
  </div>
  <!--right end--> 
</div>
<div class="foot"></div>
<div id="select_tree_menu_column" class="menuContent" style="display:none; position: absolute; z-index:32; width:200px; background-color:#FFF; border:1px solid rgb(175,175,175); border-top:none;">
  <ul id="select_tree_column" class="ztree" style="margin-top:0; width:160px;"></ul>
</div>
<script src="${contextPath }/styles/zTree/jquery.ztree.core.min.js"></script>
<script src="${contextPath }/styles/public/js/zTreeUtil.js"></script>
<script type="text/javascript" src="${contextPath }/styles/ueditor/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="${contextPath }/styles/ueditor/utf8-jsp/ueditor.all.js"></script>
<script src="${contextPath }/styles/ajaxfileupload/ajaxfileupload.js" type="text/javascript"></script>
<script src="${contextPath }/styles/public/js/upload_img.js" type="text/javascript"></script>
<script>
var ue = UE.getEditor('container', {
    toolbars: [[
        'fullscreen', 'source', '|', 'undo', 'redo', '|',
        'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
        'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
        'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
        'directionalityltr', 'directionalityrtl', 'indent', '|',
        'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
        'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
        'simpleupload', 'emotion', 'scrawl', 'map', 'insertframe', 'insertcode', 'pagebreak', 'template', 'background', '|',
        'horizontal', 'date', 'time', 'spechars', '|',
        'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
        'print', 'preview', 'searchreplace', 'drafts', 'help'
    ]],
    autoHeightEnabled: true,
    autoFloatEnabled: true,
    maximumWords: 20000,
    enableAutoSave: false,
    saveInterval: 50000,
    elementPathEnabled: false,
    initialFrameWidth: 800,
    initialFrameHeight: 220
});
function close2refresh() {
	goToPage("${contextPath}/manager/article/list");
}
$(function(){
	zTreeUtil.init("select_column", JSON.parse('${columnList}'));
});
</script>
</body>
</html>